a = 'study'
unstudy = 'u'
x = 1
y = 0.01
z = 0.001
temp = 1
state = a
for i in range (365):
    if state == a and (temp in [1,2,3]):
        x *= (1+y)
        temp = (temp + 1) % 4
    elif state == a and (temp in [0]):
        x *= (1-z)
        temp = (temp + 1) % 4
    elif state == unstudy :
        temp = 0
    else:
        pass
print ("连续学习365天后的能力值是：{:.3f}".format(x))
